﻿using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using BLL.Model.User;
using DataAnnotationsExtensions;

namespace WayCloud.ViewModel
{
    public class RegisterInfo : UserInfo
    {

        [Display(Name = "用户名"), StringLength(20), Required(AllowEmptyStrings = false, ErrorMessage = "用户名不能为空！")]
        [Remote("CheckAccountName", "Register", ErrorMessage = "该用户名已存在！")]
        public new string AccountName { get; set; }

        [Display(Name = "密码"), StringLength(20, MinimumLength = 3), Required(AllowEmptyStrings = false, ErrorMessage = "密码不能为空！")]
        public new string Password { get; set; }

        [Display(Name = "确认密码"), StringLength(20, MinimumLength = 3), Required(AllowEmptyStrings = false, ErrorMessage = "密码不能为空！"), EqualTo("Password", ErrorMessage = "两次密码必须一致")]
        public string ConfirmPassword { get; set; }

    }
}